package com.indusfo.spc.mapper;

import com.indusfo.spc.pojo.ScrapWork;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ScrapWorkMapper {

    int insertSelective(ScrapWork record);

    ScrapWork selectByPrimaryKey(Integer scrapWorkId);

    int updateByPrimaryKeySelective(ScrapWork record);
    // 查询分页
    List<ScrapWork> selectScrapWork(@Param("scrapWork")ScrapWork scrapWork,@Param("startDate")String startDate,@Param("endDate")String endDate);
    // 分页计数
    int countScrapWork(@Param("scrapWork")ScrapWork scrapWork,@Param("startDate")String startDate,@Param("endDate")String endDate);
    // 停用/启用/删除
    int definedScrapWork(@Param("scrapWorkIds") Long[] scrapWorkIds,@Param("dataState") Integer dataState);
    // 单号查重
    Integer queryScrapWorkCode(ScrapWork scrapWork);
    // 审核/反审核
    int auditScrapWork(@Param("scrapWorkIds")Long[] scrapWorkIds,@Param("auditState") Integer auditState,@Param("auditUserId") Integer auditUserId);
    // 根据报废单号查询设备ID
    List<Integer> selectByScrapWorkId(@Param("scrapWorkIds")Long[] scrapWorkIds);
    // 根据设备ID查询
    int selectByDeviceId(@Param("deviceIds") Long[] deviceIds);
}